package mn.slide.labmed;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MyDialog extends Activity{
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.kontaktdialog);
		TextView title = (TextView)findViewById(R.id.dialogtitle);
		Bundle bundle = this.getIntent().getExtras();
		final String titletext=bundle.getString("title");
		title.setText("Open "+titletext+" with browser ?");
				
		Button ja = (Button)findViewById(R.id.kontaktja);
		ja.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				// TODO Auto-generated method stub
				Uri uri = Uri.parse("http://"+titletext);
				Intent intent = new Intent(Intent.ACTION_VIEW, uri);
				startActivity(intent);
				finish();
		
			}
		});
		Button abb = (Button) findViewById(R.id.kontaktabbrech);
		abb.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				finish();
			}
		});
	}

}
